package com.donfu.system.service.house.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.donfu.system.mapper.house.HouseExclusiveserviceMapper;
import com.donfu.system.domain.house.HouseExclusiveservice;
import com.donfu.system.service.house.IHouseExclusiveserviceService;

/**
 * 我的导购Service业务层处理
 * 
 * @author donfu
 * @date 2021-12-01
 */
@Service
public class HouseExclusiveserviceServiceImpl implements IHouseExclusiveserviceService 
{
    @Autowired
    private HouseExclusiveserviceMapper houseExclusiveserviceMapper;

    /**
     * 查询我的导购
     * 
     * @param id 我的导购主键
     * @return 我的导购
     */
    @Override
    public HouseExclusiveservice selectHouseExclusiveserviceById(Long id)
    {
        return houseExclusiveserviceMapper.selectHouseExclusiveserviceById(id);
    }

    /**
     * 查询我的导购列表
     * 
     * @param houseExclusiveservice 我的导购
     * @return 我的导购
     */
    @Override
    public List<HouseExclusiveservice> selectHouseExclusiveserviceList(HouseExclusiveservice houseExclusiveservice)
    {
        return houseExclusiveserviceMapper.selectHouseExclusiveserviceList(houseExclusiveservice);
    }

    /**
     * 新增我的导购
     * 
     * @param houseExclusiveservice 我的导购
     * @return 结果
     */
    @Override
    public int insertHouseExclusiveservice(HouseExclusiveservice houseExclusiveservice)
    {
        houseExclusiveservice.setCreateDate(new Date());
        return houseExclusiveserviceMapper.insertHouseExclusiveservice(houseExclusiveservice);
    }

    /**
     * 修改我的导购
     * 
     * @param houseExclusiveservice 我的导购
     * @return 结果
     */
    @Override
    public int updateHouseExclusiveservice(HouseExclusiveservice houseExclusiveservice)
    {
        houseExclusiveservice.setUpdateDate(new Date());
        return houseExclusiveserviceMapper.updateHouseExclusiveservice(houseExclusiveservice);
    }

    /**
     * 批量删除我的导购
     * 
     * @param ids 需要删除的我的导购主键
     * @return 结果
     */
    @Override
    public int deleteHouseExclusiveserviceByIds(Long[] ids)
    {
        return houseExclusiveserviceMapper.deleteHouseExclusiveserviceByIds(ids);
    }

    /**
     * 删除我的导购信息
     * 
     * @param id 我的导购主键
     * @return 结果
     */
    @Override
    public int deleteHouseExclusiveserviceById(Long id)
    {
        return houseExclusiveserviceMapper.deleteHouseExclusiveserviceById(id);
    }

    /**
     * 根据店铺id和导购id解除绑定
     * @param userId
     * @param shopperId
     * @return
     */
    @Override
    public int deleteHouseExclusiveserviceByShopperIdAndUserId(Long userId, Long shopperId) {
        return houseExclusiveserviceMapper.deleteHouseExclusiveserviceByShopperIdAndUserId(userId,shopperId);
    }
}
